const express = require("express");
const router = express();
const config = require("./config");

const base_url = "http://" + config.IP + ":" + config.PORT + "/images/goods/";

router.post("/", (req, res) => {
    console.log(`<-- hotGoods -->`);
    var hotGoods = {
        "code" : "0000",
        "message" : "success",
        "data" : [
            {
                "name": "111111111111111",
                "image": base_url + "001/cover.jpg",
                "presentPrice": 98.88,
                "goodsId": "001",
                "oriPrice": 108.88
            },
            {
                "name": "22222222",
                "image": base_url + "002/cover.jpg",
                "presentPrice": 229.90,
                "goodsId": "002",
                "oriPrice": 329.90
            },
            {
                "name": "3333333333",
                "image": base_url + "003/cover.jpg",
                "presentPrice": 318.88,
                "goodsId": "001",
                "oriPrice": 388.88
            },
            {
                "name": "444444444",
                "image": base_url + "004/cover.jpg",
                "presentPrice": 238.88,
                "goodsId": "001",
                "oriPrice": 258.88
            },
            {
                "name": "55555555",
                "image": base_url + "005/cover.jpg",
                "presentPrice": 312.00,
                "goodsId": "001",
                "oriPrice": 399.00
            },
            {
                "name": "66666666",
                "image": base_url + "006/cover.jpg",
                "presentPrice": 99.99,
                "goodsId": "001",
                "oriPrice": 199.99
            },
            {
                "name": "777777777",
                "image": base_url + "007/cover.jpg",
                "presentPrice": 315.88,
                "goodsId": "001",
                "oriPrice": 355.88
            },
            {
                "name": "888888888888",
                "image": base_url + "008/cover.jpg",
                "presentPrice": 888.88,
                "goodsId": "001",
                "oriPrice": 999.99
            },
        ],
    };
    res.send(hotGoods);
});

module.exports = router;